#include "stdafx.h"
#include "ServiceUtil.h"

#include <Util.h>
#include <IXSystemService.h>

namespace ServiceUtil
{
    ExportXSkinLib HRESULT OpenUrl(IN LPCTSTR szURL)
    {
        XPtr<IXSystemService> sysService;
        if(SUCCEEDED(Util::CreateObject(&sysService)))
        {
            sysService->ExecProgram(XSys_Exec_Open, szURL, NULL);
        }
        return E_NOINTERFACE;
    }

    ExportXSkinLib HRESULT ExecProgram(IN LPCTSTR szExePath, IN LPCTSTR szParams)
    {
        XPtr<IXSystemService> sysService;
        if(SUCCEEDED(Util::CreateObject(&sysService)))
        {
            return sysService->ExecProgram(XSys_Exec_Open, szExePath, szParams);
        }
        return E_NOINTERFACE;
    }
}